﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace RequestCenterMgr.SPIO
{
    public partial class SPtjyh : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                try
                {
                    string strsmstype = string.Empty, //类型，天津炎黄
                        strlinkid = string.Empty,//唯一标识
                        strmobile = string.Empty,//手机号
                        strcontent = string.Empty,//内容 
                        strspnum = string.Empty,//通道号码
                        strfeecode = string.Empty,//资费 100 表示1.00元
                        strprov = string.Empty,//省份
                        stricp = string.Empty,
                        strstatus = string.Empty;//状态报告DELIVRD表示成功

                    if (Request.QueryString["smstype"] != null)
                        strsmstype = Request.QueryString["smstype"].ToString();
                    if (Request.QueryString["linkid"] != null)
                        strlinkid = Request.QueryString["linkid"].ToString();
                    if (Request.QueryString["mobile"] != null)
                        strmobile = Request.QueryString["mobile"].ToString();
                    if (Request.QueryString["content"] != null)
                        strcontent = Request.QueryString["content"].ToString();
                    if (Request.QueryString["spnum"] != null)
                        strspnum = Request.QueryString["spnum"].ToString();
                    if (Request.QueryString["feecode"] != null)
                        strfeecode = Request.QueryString["feecode"].ToString();
                    //if (Request.QueryString["prov"] != null)
                    //strprov = System.Web.HttpUtility.UrlDecode(Request.QueryString["prov"].ToString(), System.Text.Encoding.Default);
                    //strprov = Server.UrlDecode(Request.QueryString["prov"].ToString());
                    //strprov = Request.QueryString["prov"].ToString();
                    if (Request.QueryString["icp"] != null)
                        stricp = Request.QueryString["icp"].ToString();
                    if (Request.QueryString["status"] != null)
                        strstatus = Request.QueryString["status"].ToString();

                    if (!string.IsNullOrEmpty(strlinkid) && !string.IsNullOrEmpty(strsmstype) && !string.IsNullOrEmpty(strmobile) && !string.IsNullOrEmpty(strspnum))
                    {
                        MM.DBUtility.BLSqlDataSPIO.ReceiveData(strsmstype, strlinkid, strmobile, strcontent, strspnum, strfeecode, strprov, stricp, strstatus);
                        Response.Write("ok");
                    }
                }
                catch (Exception ex)
                {
                    MM.Common.LogHelp.WriteLogInfo(ex.ToString());
                    Response.Write("err");
                }
            }
        }
    }
}
